const { resolve } = require('path')

const mongoose = require(resolve(__dirname, '../db'))

const PraiseSchema = mongoose.model('praises', new mongoose.Schema({
  title: {
    type: String,
    required: [true, '文章标题不可为空!'],
    trim: true
  },
  userId: {
    type: String,
    trim: true
  },
  articleId: {
    type: String,
    trim: true
  },
  status: {
    type: Boolean,
    trim: true,
    default: false
  },
  isDel: { // 是否删除
    type: Boolean,
    trim: true,
    default: false
  }
}))

module.exports = PraiseSchema
